﻿using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.JDPostBoard.Entity
{
    [Table("ApplyLog", "", "JDPB.ConnectionString")]
    public class ApplyLog : Info
    {
        #region SQL column name consts
        public const string SQLCOL_APPLYID = "ApplyID";
        public const string SQLCOL_APPLIERID = "ApplierID";
        public const string SQLCOL_APPLIERNAME = "ApplierName";
        public const string SQLCOL_APPLIERDSNAME = "ApplierDsName";
        public const string SQLCOL_APPLIERDEPARTMENT = "ApplierDepartment";
        public const string SQLCOL_APPLYTITLE = "ApplyTitle";
        public const string SQLCOL_APPLYCOST = "ApplyCost";
        public const string SQLCOL_APPLYTIME = "ApplyTime";
        public const string SQLCOL_NILINGQUTIME = "NiLingquTime";
        
        public const string SQLCOL_DEALCONTENT = "DealContent";
        public const string SQLCOL_DEALTIME = "DealTime";
        public const string SQLCOL_DEALERID = "DealerID";
        public const string SQLCOL_DEALERNAME = "DealerName";
        public const string SQLCOL_DEALERDSNAME = "DealerDsName";
        public const string SQLCOL_STATUS = "Status";
        public const string SQLCOL_ISARRIVAL = "IsArrival";
        public const string SQLCOL_ARRIVALTIME = "ArrivalTime";
        public const string SQLCOL_ARRIVALOPERATORID = "ArrivalOperatorID";
        public const string SQLCOL_ARRIVALOPERATORNAME = "ArrivalOperatorName";
        public const string SQLCOL_ARRIVALOPERATORDSNAME = "ArrivalOperatorDsName";
        public const string SQLCOL_CONFIRMTIME = "ConfirmTime";
        public const string SQLCOL_ISENABLE = "IsEnable";
        public const string SQLCOL_REMARK = "Remark";

        public const string SQLCOL_AUDITORID = "AuditorID";
        public const string SQLCOL_AUDITORNAME = "AuditorName";
        public const string SQLCOL_AUDITORDISPLAY = "AuditorDisplay";
        public const string SQLCOL_REALDEALERID = "RealDealerID";
        public const string SQLCOL_REALDEALERNAME = "RealDealerName";
        public const string SQLCOL_REALDEALERDISPLAY = "RealDealerDisplay";
        #endregion


        #region Contructors
        /// <summary>
        /// Construct empty entity
        /// </summary>
        public ApplyLog() { }

        /// <summary>
        /// Construct entity by primary key, other fields will be assigned by 
        /// "Load" method.
        /// </summary>
        public ApplyLog(Guid ApplyID)
        {
            this.ApplyID = ApplyID;
        }
        #endregion

        public override void Init(DataRow row)
        {
            ApplyID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_APPLYID]);
            ApplierID = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERID]);
            ApplierName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERNAME]);
            ApplierDsName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERDSNAME]);
            ApplierDepartment = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERDEPARTMENT]);
            ApplyTitle = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLYTITLE]);
            ApplyCost = (double)ObjectType.DoubleTypeHelper.Read(row[SQLCOL_APPLYCOST]);
            ApplyTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_APPLYTIME]);
            NiLingquTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_NILINGQUTIME]);
            DealContent = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALCONTENT]);
            DealTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_DEALTIME]);
            DealerID = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALERID]);
            DealerName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALERNAME]);
            DealerDsName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALERDSNAME]);
            Status = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_STATUS]);
            IsArrival = (bool)ObjectType.BooleanTypeHelper.Read(row[SQLCOL_ISARRIVAL]);
            ArrivalTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_ARRIVALTIME]);
            ArrivalOperatorID = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_ARRIVALOPERATORID]);
            ArrivalOperatorName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_ARRIVALOPERATORNAME]);
            ArrivalOperatorDsName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_ARRIVALOPERATORDSNAME]);
            ConfirmTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_CONFIRMTIME]);
            IsEnable = (bool)ObjectType.BooleanTypeHelper.Read(row[SQLCOL_ISENABLE]);
            Remark = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_REMARK]);

            AuditorID = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_AUDITORID]);
            AuditorName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_AUDITORNAME]);
            AuditorDisplay = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_AUDITORDISPLAY]);
            RealDealerID = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_REALDEALERID]);
            RealDealerName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_REALDEALERNAME]);
            RealDealerDisplay = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_REALDEALERDISPLAY]);
        }

        #region Properties
        #region Property <Guid> ApplyID
        [Property("ApplyID", 16, SqlDbType.UniqueIdentifier, false, true)]
        public Guid ApplyID
        {
            get { return _ApplyID; }
            set { _ApplyID = value; }
        }
        private Guid _ApplyID = Guid.Empty;
        #endregion

        #region Property <string> ApplierID
        [Property("ApplierID", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierID
        {
            get { return _ApplierID; }
            set { _ApplierID = value; }
        }
        private string _ApplierID = null;
        #endregion

        #region Property <string> ApplierName
        [Property("ApplierName", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierName
        {
            get { return _ApplierName; }
            set { _ApplierName = value; }
        }
        private string _ApplierName = null;
        #endregion

        #region Property <string> ApplierDsName
        [Property("ApplierDsName", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierDsName
        {
            get { return _ApplierDsName; }
            set { _ApplierDsName = value; }
        }
        private string _ApplierDsName = null;
        #endregion

        #region Property <string> ApplierDepartment
        [Property("ApplierDepartment", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierDepartment
        {
            get { return _ApplierDepartment; }
            set { _ApplierDepartment = value; }
        }
        private string _ApplierDepartment = null;
        #endregion

        #region Property <string> ApplyTitle
        [Property("ApplyTitle", 100, SqlDbType.NVarChar, false, false)]
        public string ApplyTitle
        {
            get { return _ApplyTitle; }
            set { _ApplyTitle = value; }
        }
        private string _ApplyTitle = null;
        #endregion

        #region Property <double> ApplyCost
        [Property("ApplyCost", 8, SqlDbType.Float, false, false)]
        public double ApplyCost
        {
            get { return _ApplyCost; }
            set { _ApplyCost = value; }
        }
        private double _ApplyCost = double.NaN;
        #endregion

        #region Property <DateTime> ApplyTime
        [Property("ApplyTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime ApplyTime
        {
            get { return _ApplyTime; }
            set { _ApplyTime = value; }
        }
        private DateTime _ApplyTime = DateTime.MinValue;
        #endregion

        #region Property <DateTime> NiLingquTime
        [Property("NiLingquTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime NiLingquTime
        {
            get { return _NiLingquTime; }
            set { _NiLingquTime = value; }
        }
        private DateTime _NiLingquTime = DateTime.MinValue;
        #endregion
        
        #region Property <string> DealContent
        [Property("DealContent", 400, SqlDbType.NVarChar, false, false)]
        public string DealContent
        {
            get { return _DealContent; }
            set { _DealContent = value; }
        }
        private string _DealContent = null;
        #endregion

        #region Property <DateTime> DealTime
        [Property("DealTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime DealTime
        {
            get { return _DealTime; }
            set { _DealTime = value; }
        }
        private DateTime _DealTime = DateTime.MinValue;
        #endregion

        #region Property <string> DealerID
        [Property("DealerID", 100, SqlDbType.NVarChar, false, false)]
        public string DealerID
        {
            get { return _DealerID; }
            set { _DealerID = value; }
        }
        private string _DealerID = null;
        #endregion

        #region Property <string> DealerName
        [Property("DealerName", 100, SqlDbType.NVarChar, false, false)]
        public string DealerName
        {
            get { return _DealerName; }
            set { _DealerName = value; }
        }
        private string _DealerName = null;
        #endregion

        #region Property <string> DealerDsName
        [Property("DealerDsName", 100, SqlDbType.NVarChar, false, false)]
        public string DealerDsName
        {
            get { return _DealerDsName; }
            set { _DealerDsName = value; }
        }
        private string _DealerDsName = null;
        #endregion

        #region Property <string> Status
        [Property("Status", 100, SqlDbType.NVarChar, false, false)]
        public string Status
        {
            get { return _Status; }
            set { _Status = value; }
        }
        private string _Status = null;
        #endregion

        #region Property <bool> IsArrival
        [Property("IsArrival", 1, SqlDbType.Bit, false, false)]
        public bool IsArrival
        {
            get { return _IsArrival; }
            set { _IsArrival = value; }
        }
        private bool _IsArrival = false;
        #endregion

        #region Property <DateTime> ArrivalTime
        [Property("ArrivalTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime ArrivalTime
        {
            get { return _ArrivalTime; }
            set { _ArrivalTime = value; }
        }
        private DateTime _ArrivalTime = DateTime.MinValue;
        #endregion

        #region Property <string> ArrivalOperatorID
        [Property("ArrivalOperatorID", 100, SqlDbType.NVarChar, false, false)]
        public string ArrivalOperatorID
        {
            get { return _ArrivalOperatorID; }
            set { _ArrivalOperatorID = value; }
        }
        private string _ArrivalOperatorID = null;
        #endregion

        #region Property <string> ArrivalOperatorName
        [Property("ArrivalOperatorName", 100, SqlDbType.NVarChar, false, false)]
        public string ArrivalOperatorName
        {
            get { return _ArrivalOperatorName; }
            set { _ArrivalOperatorName = value; }
        }
        private string _ArrivalOperatorName = null;
        #endregion

        #region Property <string> ArrivalOperatorDsName
        [Property("ArrivalOperatorDsName", 100, SqlDbType.NVarChar, false, false)]
        public string ArrivalOperatorDsName
        {
            get { return _ArrivalOperatorDsName; }
            set { _ArrivalOperatorDsName = value; }
        }
        private string _ArrivalOperatorDsName = null;
        #endregion

        #region Property <DateTime> ConfirmTime
        [Property("ConfirmTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime ConfirmTime
        {
            get { return _ConfirmTime; }
            set { _ConfirmTime = value; }
        }
        private DateTime _ConfirmTime = DateTime.MinValue;
        #endregion

        #region Property <bool> IsEnable
        [Property("IsEnable", 1, SqlDbType.Bit, false, false)]
        public bool IsEnable
        {
            get { return _IsEnable; }
            set { _IsEnable = value; }
        }
        private bool _IsEnable = false;
        #endregion

        #region Property <string> Remark
        [Property("Remark", 1000, SqlDbType.NVarChar, false, false)]
        public string Remark
        {
            get { return _Remark; }
            set { _Remark = value; }
        }
        private string _Remark = null;
        #endregion

        #region Property <string> AuditorID
        [Property("AuditorID", 100, SqlDbType.NVarChar, false, false)]
        public string AuditorID
        {
            get { return _AuditorID; }
            set { _AuditorID = value; }
        }
        private string _AuditorID = null;
        #endregion

        #region Property <string> AuditorName
        [Property("AuditorName", 100, SqlDbType.NVarChar, false, false)]
        public string AuditorName
        {
            get { return _AuditorName; }
            set { _AuditorName = value; }
        }
        private string _AuditorName = null;
        #endregion

        #region Property <string> AuditorDisplay
        [Property("AuditorDisplay", 100, SqlDbType.NVarChar, false, false)]
        public string AuditorDisplay
        {
            get { return _AuditorDisplay; }
            set { _AuditorDisplay = value; }
        }
        private string _AuditorDisplay = null;
        #endregion

        #region Property <string> RealDealerID
        [Property("RealDealerID", 100, SqlDbType.NVarChar, false, false)]
        public string RealDealerID
        {
            get { return _RealDealerID; }
            set { _RealDealerID = value; }
        }
        private string _RealDealerID = null;
        #endregion

        #region Property <string> RealDealerName
        [Property("RealDealerName", 100, SqlDbType.NVarChar, false, false)]
        public string RealDealerName
        {
            get { return _RealDealerName; }
            set { _RealDealerName = value; }
        }
        private string _RealDealerName = null;
        #endregion

        #region Property <string> RealDealerDisplay
        [Property("RealDealerDisplay", 100, SqlDbType.NVarChar, false, false)]
        public string RealDealerDisplay
        {
            get { return _RealDealerDisplay; }
            set { _RealDealerDisplay = value; }
        }
        private string _RealDealerDisplay = null;
        #endregion

        #endregion




    }
}
